
<script type="text/javascript">
{literal}
    $(document).ready(function() {
          $('#labGroupSelectResultStructure').bind('change', function() {
        	resetLabResultData();
            showMessage('statusMessage', '', 'success');            
            var id = $('#labGroupSelectResultStructure :selected').val();  
            loadLabServicesOfSelectedGroupSec3(id, null, '');
            });

        $('#labServiceSelectResultStructure').bind('change', function() {
        	resetLabResultData();
            showMessage('statusMessage', '', 'success');
            setResultStructureDefaultData();
            var id = $('#labServiceSelectResultStructure :selected').val();
            loadResultStructureOfSelectedService(id, null, '');
        });

        $('#labResultStructureSelect').bind('change', function() {
            var id = $('#labResultStructureSelect :selected').val();            
            setSelectedLabResultStructure(id);
            $('#labResultUpdate').attr('disabled', false);
        });

        $('#labResultAdd').bind('click', function() {
            addLabResult();
            
        });

        $('#labResultUpdate').bind('click', function() {
            updateLabResult();            
        });

        showMessage('statusMessage', '', 'success');
        
        
        
    });
{/literal}
</script>

<div>&nbsp;<span id="statusMessage" style="font-style: italic; color: red;"></span></div>
<div style="float: left;">
<span class='label'>{translate}Group name{/translate}</span><br>
<select id="labGroupSelectResultStructure" size="15" style="width: 330px;">{html_options options=$labGroups selected=$selectedLabGroup}</select>
</div>
<div style="float: none;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class='label'>{translate}Lab service{/translate}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select id="labServiceSelectResultStructure" size="15" style="width: 300px;">{html_options options=$labServices}</select>
</div>
<br>
<br>
<br>
<div style="float: left">
<table class="inline" cellpadding="0" cellspacing="0" width="330px">
<tr>
    <td class='label' width="120px">{translate}Result name{/translate}</td>
    <td width="180px;">
        <input id="labResultName" type="text"  value="" style="width: 100%"/>
        <input id="labResultId" type="hidden" value="" />
    </td>
</tr>
<tr>
    <td class='label' >{translate}Unit{/translate}</td>
    <td >
        <select id="resultUnit">{html_options options=$unit}</select>
    </td>    
</tr>
<tr>
    <td class='label' >{translate}Normal(M){/translate}</td>
    <td >
        <input id="labResultNormalMale" type="text"  value="" style="width: 100%"/>
    </td>    
</tr>
<tr>
    <td class='label' >{translate}Normal(F){/translate}</td>
    <td >
        <input id="labResultNormalFemale" type="text" value="" style="width: 100%"/>
    </td>    
</tr>
<tr>
    <td class='label' >{translate}Data type{/translate}</td>
    <td >
        <select id="resultDataType">{html_options options=$dataType}</select>
    </td>    
</tr>
<tr>
       <td style="text-align: right;" colspan="2">
       <input id="labResultAdd" type="button" value="{translate}Add{/translate}"/>
       &nbsp;
       <input id="labResultUpdate" type="button" disabled="disabled" value="{translate}Update{/translate}"/></td>
    </tr>   
</table>
</div>
<div style="float: none;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class='label'>{translate}Result structure{/translate}</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select id="labResultStructureSelect" size="10" style="width: 560px;" >
</select>
</div>
<div id="hiddenData" style="display: none;"></div>

